import Vue from 'vue'
import Router from 'vue-router'
import Login from './components/Login.vue'
import Register from './components/Register.vue'
import Index from './components/Index.vue'
// import ChangePwd from './components/ChangePwd


import Home from './components/Home.vue'
import Welcome from './components/Welcome.vue'
import InterviewSituation from './views/ERecruitWeb/InterviewSituation.vue'
import NewPeoManage from './views/ERecruitWeb/NewPeoManage.vue'
import TalentInfoManagement from './views/TalentFileAdmin/TalentInfoManagement.vue'
import AttendanceManagement from './views/TalentFileAdmin/AttendanceManagement.vue'
import DisciplineManagement from './views/TalentFileAdmin/DisciplineManagement.vue'
import EvaluationManagement from './views/TalentFileAdmin/EvaluationManagement.vue'
import PerformanceManagement from './views/TalentFileAdmin/PerformanceManagement.vue'
import RecruitmentInfo from './views/PRecruitWeb/RecruitmentInfo.vue'
import InterviewResults from './views/JobAdmin/InterviewResults.vue'
import ResumeDelivery from './views/JobAdmin/ResumeDelivery.vue'
import PerInformation from './views/ETalentPortrait/PerInformation.vue'
import EnterpriseInfo from './views/CenterSet/EnterpriseInfo.vue'
import RecruitmentInfoDisplay from './views/CenterSet/RecruitmentInfoDisplay.vue'
import BasicInformation from './views/CenterSet/BasicInformation.vue'
import ResumeOperation from './views/CenterSet/ResumeOperation.vue'

// import 
Vue.use(Router)

const router = new Router({
    routes: [
        {
            path: '/',
            // redirect: '/index'
           
            component:Index
        },
        {
            path: '/index',
            name: 'index',
            component:Index
        },
        {
            path: '/login',
            name: 'login',
            component: Login
        },
        {
            path: '/register',
            name: 'register',
            component: Register
        },
        {
            path: '/changePwd',
            name: 'changePwd',
           component: () => import('./components/ChangePwd.vue'),
        },
        {
            path: '/accountSetting',
            name: 'accountSetting',
           component: () => import('./components/AccountSetting.vue'),
        },
        {
            path: '/person_information',
            name: 'person_information',
           component: () => import('./views/information/PInformation'),
        },
        {
            path: '/enterprise_information',
            name: 'enterprise_information',
           component: () => import('./views/information/EInformation'),
        },
        {
            path: '/home',
            name: 'home',
            component: Home,
            redirect: '/welcome',
            children: [

                {
                    path: '/welcome',
                    name:' Welcome',
                    component: Welcome
                },
                {
                    path: '/interviewSituation',
                    name: 'InterviewSituation',
                    component: InterviewSituation
                },
                {
                    path: '/newPeoManage',
                    name: 'NewPeoManage',
                    component: NewPeoManage
                },
                {
                    path: '/talentInfoManagement',
                    name: 'TalentInfoManagement',
                    component: TalentInfoManagement
                },
                {
                    path: '/attendanceManagement',
                    name: 'AttendanceManagement',
                    component: AttendanceManagement
                },
                {
                    path: '/disciplineManagement',
                    name:' DisciplineManagement',
                    component: DisciplineManagement
                },
                {
                    path: '/evaluationManagement',
                    name: 'EvaluationManagement',
                    component: EvaluationManagement
                },
                {
                    path: '/performanceManagement',
                    name: 'PerformanceManagement',
                    component: PerformanceManagement
                },
                {
                    path: '/recruitmentInfo',
                    name:' RecruitmentInfo',
                    component: RecruitmentInfo
                },
                {
                    path: '/interviewResults',
                    name: 'InterviewResults',
                    component: InterviewResults
                },
                {
                    path: '/resumeDelivery',
                    name: 'ResumeDelivery',
                    component: ResumeDelivery
                },
                {
                    path: '/perInformation',
                    name:' PerInformation',
                    component: PerInformation
                },
                {
                    path: '/enterpriseInfo',
                    name: 'EnterpriseInfo',
                    component: EnterpriseInfo
                },
                {
                    path: '/recruitmentInfoDisplay',
                    name: 'RecruitmentInfoDisplay',
                    component: RecruitmentInfoDisplay
                },
                {
                    path: '/basicInformation',
                    name: 'BasicInformation',
                    component: BasicInformation
                },
                {
                    path: '/resumeOperation',
                    name:' ResumeOperation',
                    component: ResumeOperation
                },
            ]
        }
    ]
})
/**
 *  路由守卫，登录拦截
 */
// router.beforeEach((to, from, next) => {
//     // to将要访问的路径
//     // from 代表从那个路径跳转而来
//     // next 一个函数表示放行
//     // next("/login") 强制跳转
//     if (to.path == "/login") return next();
//     const token = window.sessionStorage.getItem("token");
//     if (!token) return next("/login"); //如果是未登录装套转到登录页面
//     next();
// })
export default router;